-- GENERATED SPELL FOR [Polly] --


function spell0_7167(pUnit, Event) --@Stealth,Self--
pUnit:FullCastSpellOnTarget(8822,pUnit)
pUnit:RegisterEvent('Sorts_7167', 30290, 1)
end

function spell1_7167(pUnit, Event) --@Summon Polly Jr.,n/a--
pUnit:FullCastSpellOnTarget(9998,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7167', 538, 1)
end

function Sorts_7167(pUnit, Event)
local choix_sorts_7167 = math.random(0, 1)
if choix_sorts_7167 == 0 then
pUnit:RegisterEvent('spell0_7167', 1, 1)
end
if choix_sorts_7167 == 1 then
pUnit:RegisterEvent('spell1_7167', 1, 1)
end
end

function mob7167_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7167', math.random(1500, 3000), 1)
end

function mob7167_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7167_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7167_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7167, 1, 'mob7167_Action')
RegisterUnitEvent(7167, 2, 'mob7167_Leave')
RegisterUnitEvent(7167, 3, 'mob7167_Kill')
RegisterUnitEvent(7167, 4, 'mob7167_Die')
